import bean.Account;
import bean.TestType2;
import top.malaoshi.jdbc.DbSession;
import top.malaoshi.jdbc.DbSessionFactory;
import top.malaoshi.util.Out;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

public class MySQL_type {
    public static void main(String[] args) throws SQLException, ClassNotFoundException, IntrospectionException, NoSuchFieldException, InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {

        //东8时区
        String url="jdbc:mysql://localhost:3308/scott?useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai";

        DbSession session = DbSessionFactory.newSession("com.mysql.cj.jdbc.Driver"
                , url
                ,"root"
                ,"");

//        String sql = "select money from account";
        String sql = "select * from test_type";
//        List<bean.Account> list = session.query(bean.TestType.class,sql);
        List<Account> list = session.query(TestType2.class,sql);

        Out.elementSep(",\n").printList(list);


    }
}
